﻿using EntityMode;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;

namespace API.Controllers
{
    [Route("api/[controller]")]
    [ApiController]
    public class PeopleController : ControllerBase
    {
        private readonly ApiDBContext db;
        public PeopleController(ApiDBContext context)
        {
            db = context;
        }

        [HttpGet]
        public List<People> GetAll()
        {
            return db.people.ToList();
        }

        [HttpGet]
        public object GetAllJie()
        {
            return db.people.Where(s => s.Age !=1).Select(a => new
            {
                a.lable_empty
            }).ToList();
        }
    }
}
